package cn.edu.jsu.official.pojo.dto;

import cn.edu.jsu.official.serializer.DateSerializer;
import cn.edu.jsu.official.serializer.DateTimeSerializer;
import cn.edu.jsu.official.serializer.ObjectIdSerializer;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;
import java.util.List;

/**
 * @author Mo
 * @createTime 2022/3/1 16:54
 * @description
 */
@Data
@Document(collection = "copyright")
public class CopyrightInfo {
    @Id
    @ApiModelProperty("主键Id")
    private String copyrightId;

    @ApiModelProperty("软著名称")
    private String copyrightName;

    @ApiModelProperty("软著简介")
    private String copyrightIntroduction;

    @ApiModelProperty("软著作者")
    private List<String> copyrightAuthors;

    @ApiModelProperty("上传日期")
    @JSONField(serializeUsing = DateTimeSerializer.class, deserializeUsing = DateTimeSerializer.class)
    private Date uploadDate;

    @ApiModelProperty("完成日期")
    @JSONField(serializeUsing = DateSerializer.class, deserializeUsing = DateSerializer.class)
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date completedDate;

    @ApiModelProperty("封面Id")
    @JSONField(serializeUsing = ObjectIdSerializer.class, deserializeUsing = ObjectIdSerializer.class)
    private ObjectId frontCoverId;

    @ApiModelProperty("文章Id")
    @JSONField(serializeUsing = ObjectIdSerializer.class, deserializeUsing = ObjectIdSerializer.class)
    private ObjectId articleId;
}
